Part 52: Ñ| ö/ ~ öB è[ å ÑE È t 7Ò
Part 52 - Ñ| ö/ ~ öB è[ å ÑE È t 7Ò=== My Computer ===









Uh oh.




Dangerous for them, maybe.


OST: Leave No Trace
The assignment:
- Packetize and transmit the target data (file 301) to the internet so that it is uploaded to a warez site (file 300).
- A packet is a file that consists of the source IP address (from the #ADDR register), the destination IP address (from the DNS cache, file 201), the checksum of the packet's data, and between 1 and 30 data values. The target data should be split into multiple packets so that no packet except for the last contains fewer than 30 data values.
- To calculate a packet's checksum, add the data values together considering each digit separately, wrapping back to 0 when a digit's sum reaches 10. Then flip the sign. For example, the checksum of 3097, 1047, and 2501 is -6535.

Well, before I get started, I'll mess around with the hardware registers a bit. File 200 conveniently holds the link IDs to those hosts.


Let's mess with the #INVS register in the graphics host.

My eyes.


It turns out link 800 lets you go into the monitor, where you can change the contrast. At least everything resets once you stop the test simulation.
Let's get this show on the road.

Four files that actually matter. The reference to whereswarez.ru Ember prepared for us, file 301 with the actual data, then file 200 with the host addresses. It looks like the network host is 885 for the first five test cases so hopefully it stays that way and I can just hardcode that. Finally, there's file 201 with whereswarez.ru's IP address.
code:
GRAB 300
COPY F X
DROP
GRAB 301
LINK 800
LINK 885
REPL MAKER
HALT
MARK MAKER
GRAB 201
MARK FIND_DNS
TEST F = X
TJMP FOUNDIP
SEEK 1
JUMP FIND_DNS
MARK FOUNDIP
COPY F X
NOOP
Next up, making packets of 30 data values. The checksum sounds complicated so I'll leave that out of scope for now. Let's go step by step.
code:
GRAB 300
COPY F X
DROP
GRAB 301
LINK 800
LINK 885
REPL MAKER
MARK NEXTROUND
MODE; LOCAL
COPY 5 X
MARK SEND
@REP 6
COPY F M
@END
TEST EOF
TJMP EOF
SUBI X 1 X
COPY X T
TJMP SEND
COPY 0 M
MODE; GLOBAL
COPY 1 M
JUMP NEXTROUND
MARK EOF
COPY 0 M
WIPE
MODE; GLOBAL
COPY 0 M
code:
MARK MAKER
GRAB 201
MARK FIND_DNS
TEST F = X
TJMP FOUNDIP
SEEK 1
JUMP FIND_DNS
MARK FOUNDIP
COPY F X
MARK WAITNEXT
REPL NEXT
COPY M T
TJMP WAITNEXT
HALT
code:
MARK NEXT
MODE ; LOCAL
MAKE
COPY #ADDR F
COPY X F
COPY 0 F
MARK WRITENEXT6
COPY M T
FJMP DONECOPY
COPY T F
@REP 5
COPY M F
@END
JUMP WRITENEXT6
MARK DONECOPY
LINK 800


As soon as an EXA makes it to the internet, it immediately drops its file and dies with an "unknown host type" error. I can't run code on the 'net. Other than that, the simulation just shows the files sitting there in that 'internet' host forever.
It looks like this code works except for the checksums.
To calculate checksums, I need to iterate over all values, do something like a SWIZ to get each digit and then add it to a running total. That requires 2 registers at the very least. The best way to do this would probably be to use M. Thing is, I'm already using both global and local M in the network host. So that's going to be confusing. I'll try to do it in place instead. I added some code to just below the MARK DONECOPY.
code:
SEEK -9999
SEEK 3
; 1
COPY 0 X
MARK DIGIT1
@REP 6
SWIZ F 1 T
ADDI T X X
@END
TEST EOF
FJMP DIGIT1
SEEK -9999
SEEK 2
SWIZ X 1 F
code:
; 10
COPY 0 X
MARK DIGIT10
@REP 6
SWIZ F 2 T
ADDI T X X
@END
TEST EOF
FJMP DIGIT10
SEEK -9999
SEEK 2
SWIZ X 10 X
ADDI X F X
SEEK -1
COPY X F
This same code is repeated twice more for the 100s digit and 1000s digit. The only difference is that the COPY X F at the bottom of the 1000s digit is replaced by SUBI 0 X F to flip the sign. The code duplication isn't very nice but I have no registers to spare to keep a counter in.
The file is brought to the internet by the LINK 800 I already had and that's it.
This code runs at 1453/150/11, but the max size is only 100. I got it to barely fit in 98 lines by rolling up all my @REPs.
code:
GRAB 300
COPY F X
DROP
GRAB 301
LINK 800
LINK 885
REPL MAKER
MARK NEXTROUND
MODE; LOCAL
COPY 30 X
MARK SEND
;@REP 6
COPY F M
;@END
TEST EOF
TJMP EOF
SUBI X 1 X
COPY X T
TJMP SEND
COPY 0 M
MODE; GLOBAL
COPY 1 M
JUMP NEXTROUND
MARK MAKER
GRAB 201
MARK FIND_DNS
TEST F = X
TJMP FOUNDIP
SEEK 1
JUMP FIND_DNS
MARK FOUNDIP
COPY F X
MARK WAITNEXT
REPL NEXT
COPY M T
TJMP WAITNEXT
MARK NEXT
MAKE
MODE ; LOCAL
COPY #ADDR F
COPY X F
COPY 0 F
COPY M T
MARK WRITENEXT6
COPY T F
COPY M T
TJMP WRITENEXT6
SEEK -9999
SEEK 3
; 1
COPY 0 X
MARK DIGIT1
SWIZ F 1 T
ADDI T X X
TEST EOF
FJMP DIGIT1
SEEK -9999
SEEK 2
SWIZ X 1 F
; 10
COPY 0 X
MARK DIGIT10
SWIZ F 2 T
ADDI T X X
TEST EOF
FJMP DIGIT10
SEEK -9999
SEEK 2
SWIZ X 10 X
ADDI X F X
SEEK -1
COPY X F
; 100
COPY 0 X
MARK DIGIT100
SWIZ F 3 T
ADDI T X X
TEST EOF
FJMP DIGIT100
SEEK -9999
SEEK 2
SWIZ X 100 X
ADDI X F X
SEEK -1
COPY X F
; 1000
COPY 0 X
MARK DIGIT1000
SWIZ F 4 T
ADDI T X X
TEST EOF
FJMP DIGIT1000
SEEK -9999
SEEK 2
SWIZ X 1000 X
ADDI X F X
SEEK -1
SUBI 0 X F
LINK 800
MARK EOF
COPY 0 M
WIPE
MODE; GLOBAL
COPY 0 M

My score is 2653/98/11. Top percentiles are at 640, 44 and 11. I know that especially the checksum code could be a whole lot more efficient, I just wrote myself into a bit of a corner by deciding to do everything in the network host (although that did give me top percentile activity score).




I'm not sure.

---
What do you think they are?

---
It means illegal downloads of software.









If anyone has any improvements for this last puzzle, or any others before it, this is the time to post them. I'll feature those in one final edition of Trash World Inbox next week, before closing the threads.